package com.hundsun.cprs.yyt.service.common.enums;

import java.util.HashMap;
import java.util.Map;

public enum EnumUserType {
	INDIVIDUAL("2","个人","mchtType02"),
	COMPANY("1","企业","mchtType01");
	private String type;
	private String desc;
	private String mapCode;

	private EnumUserType(String type,String desc,String mapCode){
		this.type = type;
		this.desc = desc;
		this.mapCode = mapCode;
	}
	
	/**
	 * 全局索引池
	 */
	private static Map<String, EnumUserType> pool = new HashMap<String, EnumUserType>();
	static {
		for (EnumUserType et : EnumUserType.values()) {
			pool.put(et.type, et);
		}
	}

	/**
	 * 根据内容索引
	 * 
	 * @param code
	 * @return
	 */
	public static EnumUserType indexByValue(String type) {
		return pool.get(type);
	}
	
	public String getType() {
		return type;
	}
	public String getDesc() {
		return desc;
	}
	public String getMapCode() {
		return mapCode;
	}

}
